class PaymentOrderModel {
  final String orderId;
  final double amount;
  final String paymentMethod;
  final String status;
  final String? paymentUrl;
  final int createTime;

  PaymentOrderModel({
    required this.orderId,
    required this.amount,
    required this.paymentMethod,
    required this.status,
    this.paymentUrl,
    required this.createTime,
  });

  factory PaymentOrderModel.fromJson(Map<String, dynamic> json) {
    return PaymentOrderModel(
      orderId: json['order_id'] ?? '',
      amount: double.tryParse(json['amount']?.toString() ?? '0') ?? 0.0,
      paymentMethod: json['payment_method'] ?? '',
      status: json['status'] ?? '',
      paymentUrl: json['payment_url'],
      createTime: json['create_time'] ?? 0,
    );
  }
}

class PaymentStatusModel {
  final String orderId;
  final String status;
  final String? message;

  PaymentStatusModel({
    required this.orderId,
    required this.status,
    this.message,
  });

  factory PaymentStatusModel.fromJson(Map<String, dynamic> json) {
    return PaymentStatusModel(
      orderId: json['order_id'] ?? '',
      status: json['status'] ?? '',
      message: json['message'],
    );
  }
}

class PaymentMethodModel {
  final String id;
  final String name;
  final String icon;
  final bool enabled;

  PaymentMethodModel({
    required this.id,
    required this.name,
    required this.icon,
    required this.enabled,
  });

  factory PaymentMethodModel.fromJson(Map<String, dynamic> json) {
    return PaymentMethodModel(
      id: json['id'] ?? '',
      name: json['name'] ?? '',
      icon: json['icon'] ?? '',
      enabled: json['enabled'] ?? false,
    );
  }
}